<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\Stock
 *
 * @property int $id
 * @property int $user_id 购买人uid
 * @property float $price 每单位价格
 * @property int $num 购买单位
 * @property int $stock_num 股票数量
 * @property \Carbon\Carbon|null $created_at
 * @property \Carbon\Carbon|null $updated_at
 * @property string $order_no 订单号
 * @property int $status
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Stock whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Stock whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Stock whereNum($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Stock whereOrderNo($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Stock wherePrice($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Stock whereStatus($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Stock whereStockNum($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Stock whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Stock whereUserId($value)
 * @mixin \Eloquent
 * @property-read \App\Models\User $user
 */
class Stock extends Model
{
    protected $guarded = [];

    /** 购买人
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function user()
    {
        return $this->hasOne('App\Models\User', 'id', 'user_id');
    }
}
